<!DOCTYPE html>
<html lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <!-- Meta, title, CSS, favicons, etc. -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>订单信息 | </title>

    <!-- Bootstrap -->
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome -->
    <link href="css/font-awesome.min.css" rel="stylesheet">
    <!-- NProgress -->
    <!--<link href="css/nprogress.css" rel="stylesheet">-->
    <!-- FullCalendar -->
    <link href="css/fullcalendar.min.css" rel="stylesheet">
    <link href="css/fullcalendar.print.css" rel="stylesheet" media="print">
    <style>
    	
    	#bbb{
    		margin: 2px 90px;
    		float: left;
    	}
    </style>
	
		
    <!-- Custom styling plus plugins -->
    <link href="css/custom.min.css" rel="stylesheet">
  </head>

  <body class="nav-md">
    <div class="container body">
      <div class="main_container">
       <div id="head">
       	
       </div>

        <!-- page content -->
        <div class="right_col" role="main">
          <div class="">
            <div class="page-title">
            	<div class="title_left">
            		<h3>订单信息</h3>
            	</div>
									<div class="x_content">


                    <div class="" role="tabpanel" data-example-id="togglable-tabs">
                      <ul id="myTab" class="nav nav-tabs bar_tabs" role="tablist">
                        <li role="presentation" class="active"><a href="#tab_content1" id="home-tab" role="tab" data-toggle="tab" aria-expanded="true">基本信息</a>
                        </li>

                        <li role="presentation" class=""><a href="#tab_content3" role="tab" id="profile-tab2" data-toggle="tab" aria-expanded="false">收/发货信息</a>
                        </li>
                      </ul>
                      <div id="myTabContent" class="tab-content">
                        <div role="tabpanel" class="tab-pane fade active in" id="tab_content1" aria-labelledby="home-tab">
                           <div class="row" id="bbb">
              
              					<div class="row">
                          <label class="col-sm-1 control-label" style="text-align: right;" for="orderNumber">订单号：</label>
                          <div class="col-sm-2">
                             <input class="form-control" id="orderNumber" type="text" readonly/>
                          </div>
                          <label class="col-sm-1 control-label" style="text-align: right;" for="bookingid">订舱申请号：</label>
                          <div class="col-sm-2">
                             <input class="form-control"  id="bookingid" type="text" readonly/>
                          </div>
                           <label class="col-sm-1 control-label" style="text-align: right;" for="customerName">客户：</label>
                          <div class="col-sm-2">
                             <input class="form-control"  id="customerName" type="text" readonly/>
                          </div>
                           <label class="col-sm-1 control-label" style="text-align: right;" for="exportorgname">出口组织：</label>
                          <div class="col-sm-2">
                             <input class="form-control" id="exportorgname" type="text" readonly	/>
                          </div>
                       </div>
                       <div class="row" style="margin-bottom: 8px;">
                       	 <label class="col-sm-1 control-label" style="text-align: right;" for="createtime">创建日期：</label>
                          <div class="col-sm-2">
                             <input class="form-control" id="createtime" type="text" readonly/>
                          </div>
                          <label class="col-sm-1 control-label" style="text-align: right;" for="ordertime">受理日期：</label>
                          <div class="col-sm-2">
                             <input class="form-control"  id="ordertime" type="text" readonly/>
                          </div>

                          <label class="col-sm-1 control-label" style="text-align: right;" for="cUsername">业务员：</label>
                          <div class="col-sm-2">
                             <input class="form-control" id="cUsername" type="text" readonly/>
                          </div>
                           <label class="col-sm-1 control-label" style="text-align: right;" for="statusid">订单状态：</label>
                           <div class="col-sm-2">
                               <input class="form-control"  id="statusid" type="text" readonly/>
                           </div>
                       </div>
                       <div class="row" style="margin-bottom: 8px;">
                          <label class="col-sm-1 control-label" style="text-align: right;" for="declarelocpath">报关：</label>
                          <div class="col-sm-2">
                             <input class="form-control" id="declarelocpath" type="text" readonly/>
                          </div>

                          
                       </div>	
    							
    									</div>
                        </div>

                        <div role="tabpanel" class="tab-pane fade" id="tab_content3" aria-labelledby="profile-tab">
                            <div class="row" id="bbb2">
              
              					<div class="row">
                          <label class="col-sm-1 control-label" style="text-align: right;" for="senderName">发货人：</label>
                          <div class="col-sm-2">
                             <input class="form-control" id="senderName" type="text" readonly/>
                          </div>
                          <label class="col-sm-1 control-label" style="text-align: right;" for="recipients">收货人：</label>
                          <div class="col-sm-2">
                             <input class="form-control"  id="recipients" type="text" readonly/>
                          </div>
                           <label class="col-sm-1 control-label" style="text-align: right;" for="notifyparty">通知人：</label>
                          <div class="col-sm-2">
                             <input class="form-control"  id="notifyparty" type="text" readonly/>
                          </div>
                                    <label class="col-sm-1 control-label" style="text-align: right;" for="address">寄件地点：</label>
                                    <div class="col-sm-2">
                                        <input class="form-control" id="address" type="text" readonly/>
                                    </div>
                       </div>
                       
    							
    									</div>
                        </div>
                      </div>
                    </div>

                  </div>
            
    									
    										
            </div>
				

            <div class="x_panel">
                  <div class="x_title">
                    <h2>预排柜信息 </h2>
                    <ul class="nav navbar-right panel_toolbox">
                      <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
                      </li>
                    </ul>
                    <div class="clearfix"></div>
                  </div>
                  <div class="x_content">

                    <table id="table1" class="table table-striped">
                        <thead>
                        <tr>
                            <th>预排柜号</th>
                            <th>箱型</th>
                            <th>箱量</th>
                            <th>尺寸</th>
                            <th>ETD</th>
                            <th>ETA</th>
                            <th>订舱金额</th>
                        </tr>
                        </thead>

                        <tbody>
                        <tr>
                            <td id="yconId"></td>
                            <td id="ycontype"></td>
                            <td id="yconamount"></td>
                            <td id="yconsize"></td>
                            <td id="etd"></td>
                            <td id="eta"></td>
                            <td id="yMoney"></td>
                        </tr>
                        </tbody>
                      

                    </table>
                      <span id="tableError" style="display: none;color: red;font-size: 20px;margin-left:550px"></span>
                  </div>
                </div>
        </div>
        <!-- /page content -->

        <!-- footer content -->
        <!-- /footer content -->
      </div>
    </div>

    </div>
        
    <!-- jQuery -->
    <script src="js/jquery.min.js"></script>
    <!-- Bootstrap -->
    <script src="js/bootstrap.min.js"></script>
    <!-- FastClick -->
    <script src="js/fastclick.js"></script>
    <!-- NProgress -->
    <script src="js/nprogress.js"></script>
    <!-- FullCalendar -->
    <script src="js/moment.min.js"></script>
    <script src="js/fullcalendar.min.js"></script>
    <script src="js/icheck.min.js"></script>

    <!-- Custom Theme Scripts -->
    <!--<script src="js/custom.min.js"></script>-->
	
		<style >
			.checkbox-custom {
    position: relative;
    padding: 0 15px 0 25px;
    margin-bottom: 7px;
    margin-top: 0;
    display: inline-block;
}
/*
将初始的checkbox的样式改变
*/
.checkbox-custom input[type="checkbox"] {
    opacity: 0;/*将初始的checkbox隐藏起来*/
    position: absolute;
    cursor: pointer;
    z-index: 2;
    margin: -6px 0 0 0;
    top: 50%;
    left: 3px;
}
/*
设计新的checkbox，位置
*/
.checkbox-custom label:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    margin-top: -9px;
    width: 19px;
    height: 18px;
    display: inline-block;
    border-radius: 2px;
    border: 1px solid #bbb;
    background: #eee;
}
/*
点击初始的checkbox，将新的checkbox关联起来
*/
.checkbox-custom input[type="checkbox"]:checked +label:after {
    position: absolute;
    display: inline-block;
    font-family: 'Glyphicons Halflings';
    content: "\e013";
    top: 48%;
    left: 4px;
    margin-top: -5px;
    font-size: 11px;
    line-height: 1;
    width: 16px;
    height: 16px;
    color: #333;
}
.checkbox-custom label {
    cursor: pointer;
    line-height: 1.2;
    font-weight: normal;/*改变了rememberme的字体*/
    margin-bottom: 0;
    text-align: left;
}
			
		</style>
    <!-- FullCalendar -->
    <script>
        function   formatDate(now)   {
            var   year=now.getFullYear();
            var   month=now.getMonth()+1;
            var   date=now.getDate();
            var  hours=now.getHours();
            var minutes = now.getMinutes();
            var seconds = now.getSeconds();
            return   year+"年"+month+"月"+date+"日    "+hours+"时"+minutes+"分"+seconds+"秒";
        }
        var $token=window.sessionStorage.getItem('token');
        var url = window.location.href;
        var termsId = url.split("=")[1];


        $.ajax({
            type:"post",
            xhrFields:{withCredentials:true},
            url:"http://localhost:8081/OrderController/showOrderAll",
            dataType:"json",
            data:{"orderNumber":termsId,"token":$token},
            success:function (data) {
                var   d=new   Date(data.ordertime);
                if (data.bookingid==null){
                    $("#orderNumber").val(termsId);
                    $("#bookingid").val("");
                    $("#customerName").val(data.customerName);
                    $("#exportorgname").val(data.goodDescription);
                    $("#createtime").val(data.createtime);
                    $("#ordertime").val(data.ordertime);
                    $("#cUsername").val(data.cUsername);
                    if (data.declarelocpath!=null){
                        $("#declarelocpath").val("已报关");
                    }else {
                        $("#declarelocpath").val("未报关");
                    }
                    $("#statusid").val(data.statusid);
                    $("#senderName").val(data.senderName);
                    $("#recipients").val(data.recipients);
                    $("#notifyparty").val("");
                    $("#address").val(data.address);
                    $("#table1").hide();
                    $("#tableError").show();
                    $("#tableError").html("此订单没有生成预排柜,暂时查询不到数据！");
                }else {
                    $("#orderNumber").val(termsId);
                    $("#customerName").val(data.customerName);
                    $("#exportorgname").val(data.goodDescription);
                    $("#createtime").val(data.createtime);
                    $("#ordertime").val(data.ordertime);
                    $("#cUsername").val(data.cUsername);
                    if (data.declarelocpath!=null){
                        $("#declarelocpath").val("已报关");
                    }else {
                        $("#declarelocpath").val("未报关");
                    }
                    $("#statusid").val(data.statusid);
                    $("#senderName").val(data.senderName);
                    $("#recipients").val(data.recipients);
                    $("#address").val(data.address);
                    $.ajax({
                        type:"post",
                        xhrFields:{withCredentials:true},
                        url:"http://localhost:8081/OrderController/showOrderBooking",
                        dataType:"json",
                        data:{"bookingno":data.bookingid,"token":$token},
                        success:function (Booking) {
                            if (Booking.yconno==null){
                                $("#bookingid").val(Booking.bookingno);
                                $("#notifyparty").val(Booking.notifyparty);
                                $("#table1").hide();
                                $("#tableError").show();
                                $("#tableError").html("此订单没有生成预排柜,暂时查询不到数据！");
                            }else {
                                $("#bookingid").val(Booking.bookingno);
                                $("#notifyparty").val(Booking.notifyparty);
                                $.ajax({
                                    type:"post",
                                    xhrFields:{withCredentials:true},
                                    url:"http://localhost:8081/OrderController/showOrderYcon",
                                    dataType:"json",
                                    data:{"yconId":Booking.yconno,"token":$token},
                                    success:function (Ycon) {
                                        var   $etd=new   Date(Ycon.etd);
                                        var   $eta=new   Date(Ycon.eta);
                                        $("#yconId").html(Ycon.yconId);
                                        $("#ycontype").html(Ycon.ycontype);
                                        $("#yconamount").html(Ycon.yconamount);
                                        $("#yconsize").html(Ycon.yconsize);
                                        $("#etd").html(formatDate($etd));
                                        $("#eta").html(formatDate($eta));
                                        $("#yMoney").html(Ycon.yMoney);
                                    },
                                    error:function(){
                                        alert("异常");
                                    }
                                });
                            }
                        },
                        error:function(){
                            alert("异常");
                        }
                    });

                }
            },
            error:function(){
                alert("异常");
            }
        });






      $(window).load(function() {
      	$("#head").load("head.html");
      	$("#gsearch").click(function(){
 					 $("#bbb").toggle();
				});
      	$(".aa").click(function  () {
      		var $check=$("#RememberMe1").prop("checked");
      		if($check==true){
					$("input[name='procheck']").prop("checked", true);
					}else if($check==false){
						$("input[name='procheck']").prop("checked", false);
					}
      	});
        var date = new Date(),
            d = date.getDate(),
            m = date.getMonth(),
            y = date.getFullYear(),
            started,
            categoryClass;

        var calendar = $('#calendar').fullCalendar({
          header: {
            left: 'prev,next today',
            center: 'title',
            right: 'month,agendaWeek,agendaDay'
          },
          selectable: true,
          selectHelper: true,
          select: function(start, end, allDay) {
            $('#fc_create').click();

            started = start;
            ended = end;

            $(".antosubmit").on("click", function() {
              var title = $("#title").val();
              if (end) {
                ended = end;
              }

              categoryClass = $("#event_type").val();

              if (title) {
                calendar.fullCalendar('renderEvent', {
                    title: title,
                    start: started,
                    end: end,
                    allDay: allDay
                  },
                  true // make the event "stick"
                );
              }

              $('#title').val('');

              calendar.fullCalendar('unselect');

              $('.antoclose').click();

              return false;
            });
          },
          eventClick: function(calEvent, jsEvent, view) {
            $('#fc_edit').click();
            $('#title2').val(calEvent.title);

            categoryClass = $("#event_type").val();

            $(".antosubmit2").on("click", function() {
              calEvent.title = $("#title2").val();

              calendar.fullCalendar('updateEvent', calEvent);
              $('.antoclose2').click();
            });

            calendar.fullCalendar('unselect');
          },
          editable: true,
          events: [{
            title: 'All Day Event',
            start: new Date(y, m, 1)
          }, {
            title: 'Long Event',
            start: new Date(y, m, d - 5),
            end: new Date(y, m, d - 2)
          }, {
            title: 'Meeting',
            start: new Date(y, m, d, 10, 30),
            allDay: false
          }, {
            title: 'Lunch',
            start: new Date(y, m, d + 14, 12, 0),
            end: new Date(y, m, d, 14, 0),
            allDay: false
          }, {
            title: 'Birthday Party',
            start: new Date(y, m, d + 1, 19, 0),
            end: new Date(y, m, d + 1, 22, 30),
            allDay: false
          }, {
            title: 'Click for Google',
            start: new Date(y, m, 28),
            end: new Date(y, m, 29),
            url: 'http://google.com/'
          }]
        });
      });
    </script>
    <!-- /FullCalendar -->
  </body>
</html>
